{% load i18n %}

<script type="text/javascript" charset="utf-8">
	var ajax_get_comment_form_url = '{{ ajax_get_comment_form_url }}'
	
	//-------------------------------------------------------------------------
	// 
	function displayFormComment() {
		c=document.getElementById('add-comment')
		if (c.style.display == "none") {
			c.style.display="block"
			loadAjaxCommentForm();
		} else {
			c.style.display = "none"
		}
	}	
	
	//-------------------------------------------------------------------------
	// 
	function ajaxCommentFormResult(responseText) {	
		document.getElementById('add-comment').innerHTML = responseText;
		//document.getElementById('add_new_comment').innerHTML = "Новый комментарий"
		//document.getElementById('add_new_comment').style.borderBottom = "1px solid #dddddd";
    }
	
	//-------------------------------------------------------------------------
	// 
	function loadAjaxCommentForm() {
		//doAjax("GET", ajax_get_comment_form_url, null, ajaxCommentFormResult);
		$.get(ajax_get_comment_form_url, null, ajaxCommentFormResult);
	}
		
</script>

	<a href="#" onclick="displayFormComment(); return false;">
		Добавить комментарий &raquo;
	</a>
	
	<div id="add-comment">
	</div>

</div>



<script type="text/javascript" charset="utf-8">
	document.getElementById('add-comment').style.display="none"
</script>
